package cn.juque.jdfsystem.listener;

import cn.hutool.core.util.ClassUtil;
import cn.juque.jdfsystem.entity.RegisterInfo;
import cn.juque.lucenecandy.bo.IndexUpdateParamBO;
import cn.juque.lucenecandy.core.datasync.listener.ICommitListener;
import org.springframework.stereotype.Service;

/**
 * @author juque
 * @version 1.0.0
 * <ul>
 *     <li>本地注册信息不做数据同步</li>
 * </ul>
 * @date 2024-01-08
 **/
@Service("ignoreRegisterListener")
public class IgnoreRegisterListener implements ICommitListener {
    @Override
    public Boolean before(IndexUpdateParamBO param) {
        return !ClassUtil.equals(RegisterInfo.class, param.getClassName(), false);
    }

    @Override
    public void after(IndexUpdateParamBO param) {
        // do nothing
    }
}
